package com.ssl.security.constants;

import com.ssl.security.exception.SecurityException;

/**
 * 描述：keystore 类型
 *
 * @author ssl
 * @create 2021/3/19 0019.
 */
public enum KeyStoreTypeEnum {
    // PKCS#12中定义的个人身份信息传输格式
    pkcs12,
    // sun提供的专有密钥库实现
    jks,
    // SunJCE 提供的专有密钥库实现
    jceks;

    public String getValue() throws SecurityException {
        switch (this) {
            case pkcs12:
                return "pkcs12";
            case jks:
                return "jks";
            case jceks:
                return "jceks";
            default:
                throw new SecurityException("不支持的 keyStore 类型。");
        }
    }
}
